package com.tyut.homework.service;

import com.tyut.homework.dto.ClazzPeopleNum;
import com.tyut.homework.dto.DorClazz;
import com.tyut.homework.dto.DorStatus;
import com.tyut.homework.dto.DormitoryDTO;
import com.tyut.homework.pojo.Dormitory;
import com.tyut.homework.pojo.StuDor;
import org.springframework.data.domain.Page;

import java.util.List;

public interface DormitoryService extends ServiceTemplate<Dormitory> {
    @Override
    Dormitory save(Dormitory dormitory);

    @Override
    int delete(Integer id);

    @Override
    int update(Dormitory dormitory);

    @Override
    Dormitory find(Integer id);

    @Override
    List<Dormitory> findAll();

    @Override
    Page<Dormitory> getPage(Integer pageNum, Integer pageLimit);

    void getDors(Integer apartsNum);

    /**
     * 获取班级和 男女人数信息
     */
    List<ClazzPeopleNum> getAllClazzPeopleNum(String sex);

    void autoMatch();

//    @Query(value = "select d from Dormitory d where d.status=0")
//    List<Dormitory> selectAllNotMatch();
//
//    @Transactional
//    @Modifying
//    @Query(value = "update dormitory set status=1 where id=?1",nativeQuery = true)
//    int updateStatus(Integer id);
     List<Dormitory> selectAllNotMatch();

     int updateStatus(Integer id);

     void updateClazz(Dormitory dormitory);

     List<DorStatus> getDOrsStatus();

     // 根据班级查询宿舍信息
    List<DormitoryDTO> findByClazz(String clazz);
    // 学生入住
    void insertInDor(Integer stuId,Integer aptId, Integer dorId);
}
